#ifndef _CORE_UTILS_NUMBER_H_
#define _CORE_UTILS_NUMBER_H_

#include "Define.h"

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @brief 日期定义
 */
typedef struct {
    uint32_t        year;
    uint32_t        mon;
    uint32_t        day;
    uint32_t        hour;
    uint32_t        min;
    uint32_t        sec;
    uint32_t        msec;
} DateDefine;

/**
 * @brief string to uint32_t
 * @param input
 * @param inputLen
 * @param output
 * @return
 */
int32_t string2Uint32(char *input, uint8_t inputLen, uint32_t *output);
/**
 * @brief string to uint64_t
 * @param input
 * @param inputLen
 * @param output
 * @return
 */
int32_t string2Uint64(char *input, uint8_t inputLen, uint64_t *output);
/**
 * @brief uint32 to string
 * @param input
 * @param output
 * @param outputLen
 * @return
 */
int32_t uint32ToString(uint32_t input, char *output, uint8_t *outputLen);
/**
 * @brief uint64 to string
 * @param input
 * @param output
 * @param outputLen
 * @return
 */
int32_t uint64ToString(uint64_t input, char *output, uint8_t *outputLen);
/**
 * @brief int32 to string
 * @param input
 * @param output
 * @param outputLen
 * @return
 */
int32_t int32ToString(int32_t input, char *output, uint8_t *outputLen);
/**
 * @brief int32 to hex string
 * @param input
 * @param output
 * @param outputLen
 * @return
 */
int32_t int32ToHexStr(int32_t input, char *output, uint8_t *outputLen);
/**
 * @brief hex to string
 * @param input
 * @param inputLen
 * @param output
 * @param lowercase
 * @return
 */
int32_t hex2String(uint8_t *input, uint32_t inputLen, char *output, uint8_t lowercase);
/**
 * @brief string to hex
 * @param input
 * @param inputLen
 * @param output
 * @return
 */
int32_t string2hex(char *input, uint32_t inputLen, uint8_t *output);
/**
 * @brief utc timestamp to data
 * @param utc
 * @param zone
 * @param date
 * @return
 */
int32_t utc2date(uint64_t utc, int8_t zone, DateDefine *date);


#ifdef __cplusplus
}
#endif

#endif //_CORE_UTILS_STRING_H_
